-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow TryNext to have an error message without it affecting the command chain #1703
Conversation
Test results for commit cdd3c85 merged into master
Not available for testing: python2.6 |
The test failure on 3.2 is issue #1699, nothing to do with this pull request. |
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
def __init__(self, _msg="", *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this _msg instead of msg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you can give it keyword arguments to pass to the next function in the chain, and it's possible, if unlikely, that you might use msg
as a keyword argument. So it deliberately looks special because it's handled differently to other keyword arguments.
Test results for commit cdd3c85 merged into master
Not available for testing: |
1 similar comment
Test results for commit cdd3c85 merged into master
Not available for testing: |
Seems sensible to me, merging. |
Allow TryNext to have an error message without it affecting the command chain added as `_msg`, relaying `**kwargs` closes #211
Allow TryNext to have an error message without it affecting the command chain added as `_msg`, relaying `**kwargs` closes ipython#211
Closes gh-211